package stack

import (
	"gvm/instructions/base"
	"gvm/rtda"
)

type SWAP struct {
	base.NoOperandsInstruction
}

func (self *SWAP) Execute(jFrame *rtda.JFrame) {
	stack := jFrame.OperandStack()
	v1 := stack.PopSlot()
	v2 := stack.PopSlot()
	stack.PushSlot(v1)
	stack.PushSlot(v2)
}
